﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Convertor.Interface
{
    public abstract class PluginBase : IConvert, IPluginLog, IPluginInit, IPluginInfo, IPluginConfigForm, IPluginConfig, IPluginConfigLoader
    {
        #region IConvertParamters 成员

        abstract public IConvertParamters Output(IConvertParamters content);

        #endregion

        #region IPluginInit 成员

        virtual public void InitPlugin() { }

        #endregion

        #region IPluginLog 成员

        public LogDelegate Log
        {
            get;
            set;
        }

        protected void logTo(string info, LogTypes logType)
        {
            if (Log != null)
            {
                Log(this, info, logType);
            }
        }
        #endregion

        #region IPluginInfo 成员

        abstract public string Name { get; }
        abstract public string Description { get; }
        public bool IsSelected { get; set; }
        public int Order { get; set; }

        #endregion

        #region IPluginConfig 成员

        virtual public object Config { get; set; }

        #endregion

        #region IPluginConfigForm 成员

        virtual public PluginConfigForm ConfigForm { get; set; }

        #endregion

        #region IPluginConfigLoader 成员

        public PluginConfigLoader Loader { get; set; }

        #endregion
    }
}
